Skip to main content

greater-than-or-equals

Type

operator

Summary

Compares two values and returns true if the first value is greater than or equal to the second value, false otherwise.

Syntax

<value1> >= <value2>

Description

Use the >= (greater than or equal to) operator to compare two numbers or to compare the alphabetical order of two strings.

When comparing strings, the >= operator compares the two values character by character, using the ASCII value of each character. For example, "z" comes after "a" in the ASCII character set, so the following are all true:

    \"z\" >=\"z\"
\"z\" >= \"a\"
\"zz\" >= \"za\"

If the strings are of different lengths, so that the trailing characters in one string are compared to missing characters in the other, the missing characters are considered to have lower value than any character. For example, "abc" >= "ab".

If the caseSensitive property is true, the comparison between two strings treats uppercase letters as coming before lowercase letters. If the caseSensitive property is false, the comparison is not case-sensitive, so a is considered equivalent to A.

Parameters

NameTypeDescription

value1

The operands value1 and value2 can be numbers, literal strings of characters (delimited with double quotes), or any sources of value.

value2

The operands value1 and value2 can be numbers, literal strings of characters (delimited with double quotes), or any sources of value.

Examples

put 22 >= 23
-- evaluates to false
local theCount
if theCount >= 0 then
go next card
end if

function: max

glossary: ASCII, case-sensitive, character set, delimit, double quote, operator, property, return, string, value

keyword: character

operator: greater-than, less-than-or-equals

property: caseSensitive

Compatibility and Support

Introduced

LiveCode 1.0

OS

mac

windows

linux

ios

android

Platforms

desktop

server

mobile

Thank you for your feedback!

Was this page helpful?